home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / news / readers / rn / rn.4.4.patch.3.part.2 < prev    next >
Encoding:
Text File  |  1992-02-23  |  52.9 KB  |  1,800 lines

  1. This is rn 4.4 patch number 3 Part 2 of 3
  2.  
  3. Please note that rn 4.4 on lib.tmc.edu, gazette.bcm.tmc.edu, bcm.tmc.edu
  4. and tmc.edu have all been updated to rn 4.4.3 and have this patch installed.
  5.  
  6. Description: [Most changes came from trn's author, Wayne Davison]
  7.  
  8.    o    Configure changes:  check for active.times (see new-group comments
  9.     below), termios systems (see termios comments later on), and also
  10.     ask if ORGANIZATION should be ignored.  This latter change allows
  11.     systems that use the ORGANIZATION variable for their own purposes
  12.     a chance to only use NEWSORG, thus allowing them to take advantage
  13.     of the default if NEWSORG is undefined (without this, everyone who
  14.     uses rn would _have_ to define NEWSORG to avoid the ORGANIZATION
  15.     define).
  16.    o    Pnews.SH: support ignoring of ORGANIZATION; echo --> $echo;
  17.     cat --> $cat.
  18.    o    Rnmail.SH: support ignoring of ORGANIZATION.
  19.    o    Many files: I've change the parameters of any function trying to
  20.     pass a character (including bool) into a type_int (e.g. char_int).
  21.     This avoids errors for ANSI compilers that don't believe that the
  22.     promoted argument type is valid (they try to pass a char as a char,
  23.     without promoting it to an int, and complain about the old syntax).
  24.    o    addng.c:  the new new-group-finding code is in here.  Optimized the
  25.     writing/reading of newsgroup lists by using "w+" and rewinding the
  26.     file.  If ACTIVE_TIMES is defined, the new function find_new_groups()
  27.     uses the NEWGROUPS command (in NNTP) or the ACTIVE_TIMES file (in
  28.     regular rn) to determine new groups.  If it's not defined, then the
  29.     find_new_groups() function does the old method (using the code moved
  30.     here from init.c).
  31.    o    added the DEB_NNTP define to output some useful NNTP debugging info
  32.     without having all information scroll by like it does with the NNTP
  33.     clientlib's debugging turned on.
  34.    o    I optimized a few of the sscanf's to use "%*d" to skip numbers
  35.     that were being ignored, and removed the useless variables.
  36.    o    art.c:  enhanced the Newsgroups-magic code to show the Newsgroups
  37.     line if it doesn't match the current group.  I find this really
  38.     useful for browsing through junk or seeing which articles have
  39.     been redirected with C new's '=' directive.
  40.    o    autosub.c:  reordered the include files to avoid a problem with
  41.     ANSI compilers.
  42.    o    bits.c:  fixed a bug in the instr() call in the !NORELAY section
  43.     (the ", TRUE" was in the wrong place).
  44.    o    common.h, etc:  if TERMIOS is defined, include termios.h and use
  45.     some slightly different term functions.  Configure was smart enough
  46.     to NOT set this for suns, and a few other systems that don't like it.
  47.    o    common.h:  if __STDC__ is defined, turn on the ANSI() prototypes
  48.     automatically.
  49.    o    common.h:  nullstr[] = ""; actually generates a warning(!) on some
  50.     weird compilers -- changed to nullstr[1] = "";.
  51.    o    common.h:  "Can't recreate..." message is used in the .newnewsrc
  52.     writing code.
  53.    o    config.h.SH:  conditionalize the including of the config.sh file
  54.     like the other .SH files do.  Also added the new Configure stuff.
  55.    o    config.h.SH needs to have its RCS comment character changed to "# ".
  56.    o    config.h.SH:  all the changes in the tail end are tab/space changes
  57.     that force the code to look pretty in config.h no matter if it is
  58.     preceded by a "#define" or a "/*#undef".
  59.    o    final.c:  int_catcher() needs an int parameter to agree with ANSI
  60.     compilers.  sig_catcher() had an assumed int parameter warning.
  61.    o    init.c:  more new-group changes (i.e. it calls find_new_groups(),
  62.     and the old new-group code was moved to addng.c).
  63.    o    intrp.c:  changes to support ignoring ORGANIZATION.  A slight tweak
  64.     allows the organization file not not end in a newline.
  65.    o    intrp.c:  moved the tmpbuf[] into the #ifdefs where it is used (to
  66.     avoid an "unused" warning.  In the process, discovered a bug in the
  67.     non-BSD code that tries to copy an uninitialized (now undefined) tmpbuf
  68.     into buf (when it should be copying 's').
  69.    o    last.c:  extended the contents of .rnlast to support the new-group
  70.     code.  Handles reading the old .rnlast style gracefully.
  71.    o    ng.c:  reset the value of extractdest and extractprog when entering
  72.     a newsgroup.  This allows someone to set SAVEDIR to a roving value
  73.     (like %c) and have an 'e' in group1 not affect an 'e' in group2.
  74.     Within the group, each 'e' command will repeat the last destination
  75.     and program if no parameters are used.
  76.    o    ng.c:  note the values returned by the GROUP command in rrn so that
  77.     we can add new articles that came in since our last fetch of the
  78.     active file.  I've upgraded the ngmax[] array to non-debug status,
  79.     and now use it to keep the group's maximum value (like abs1st[]
  80.     does for the minimum).  This allows getngsize() to return a value
  81.     higher than what is contained in the active file copy, and also
  82.     to fetch a new copy of the active file if enough time has elapsed
  83.     since our last fetch.
  84.    o    ng.c:  fixed forcelast to get cleared before processing a command,
  85.     and to get set on '-' just in case it goes to the end of the group.
  86.    o    ng.c:  fixed some indent problems.
  87.    o    ngdata.c:  added the lastactfetch variable (rrn) to keep track of
  88.     when the active file copy was last fetched.
  89.    o    ngdata.c:  getngsize() uses the value in ngmax[] to override the
  90.     high active-file-copy value.  If ngmax[] is bigger and enough time
  91.     has gone by, a new copy of the active file is fetched.
  92.    o    ngdata.c:  more indent tweaks.
  93.    o    ngdata.c:  fixed a1st to be a long (it might have been int or long,
  94.     and sscanf() was expecting an int), and added "last" to sscanf the
  95.     high newsgroup value at the same time abs1st is being set.  Fixed
  96.     a problem with the sscanf being executed if the NNTP command failed.
  97.    o    ngdata.c:  minor tweak to the "notdef" comment to make it accurate.
  98.    o    ngdata.h:  MINFETCHTIME is set for 5 minutes before another active
  99.     fetch is allowed.
  100.    o    rcln.c:  minor optimization to remove tmpp; removed #ifdef DEBUGGING
  101.     around the ngmax[] array; put \n's before the bogus newsgroup
  102.     warnings.
  103.    o    Allow some slack in the "newsgroup was reset" check to allow for the
  104.     interaction of the ngmax[] array setting a high value in .newsrc
  105.     that a cached version of the active file doesn't reflect yet (can
  106.     happen when starting up rn in some rare cases).
  107.    o    rcstuff.c:  broke out the code that parses the newsrc line into the
  108.     function parse_rcline().  This allows the addition of a new function,
  109.     abandon_ng() that restores the startup values for the current group
  110.     from the .oldnewsrc file (bound to the 'A' command at the newsgroup
  111.     level).
  112.    o    rcstuff.c:  made addnewbydefault a global variable so that it could
  113.     be reset by the 'a' command.  Without this, typing 'N' during the
  114.     startup code would render the 'a' command useless, since all the
  115.     groups you might want to add get an immediate 'n'o answer.
  116.    o    rcstuff.c:  the "if (mode == 'i')" check is needed to keep the
  117.     new-newsgroup-finding code sane.
  118.    o    rcstuff.c:  I changed the code to add groups with a space after
  119.     the ":" or "!".  It's not really required, but it avoids having the
  120.     construct "group!187,193" show up in your .newsrc file when cross-
  121.     posted articles are marked as read for unsubscribed groups.
  122.    o    rcstuff.c:  the .newnewsrc-writing code uses the "cantrecreate"
  123.     message from common.h, and the comments and indentation are fixed,
  124.     as well as one extra ferror() check added.
  125.    o    rcstuff.c:  the newsrc-array-growing code now zeros the ngnum array.
  126.    o    respond.c: moved a negation used with strlen() to avoid problems if
  127.     strlen() is declared to be unsigned.
  128.    o    respond.c: changed the behavior of the 'f' command to ask the
  129.     user if it is an unrelated topic.
  130.    o    rn.c:  added the "direction" flag that makes the 'p' and 'P' command
  131.     work in all circumstances.  Without this, if you have a restriction
  132.     enabled and an empty non-matching group in the way, it won't backup
  133.     at all (and might even go forward!).
  134.    o    rn.c:  your change for outputting the prompt later in the game allows
  135.     for the removal of the reprompt_newsgroup label with the moving of
  136.     the dfltcmd initialization also.
  137.    o    rn.c:  when rrn visits the end of the newsgroups prompt, it will
  138.     fetch a new copy of the active file if enough time has elapsed.
  139.    o    rn.c:  changed the "not found" prompt to mention the 'a' command
  140.     (which is much more useful than 'g' alone).  Made 'g's error
  141.     message a little more clear too.
  142.    o    rn.c:  more indentation twiddles.
  143.    o    rn.c:  removed the check for ' ' from the catchup code, because it's
  144.     getting changed into the default command by setdef().
  145.    o    rn.c:  added the 'A' command to abandon the current newsgroup's
  146.     changes back to the startup state (which is contained in .oldnewsrc).
  147.    o    rn.c:  have the 'a' command reset addnewbydefault to 0.
  148.    o    term.c:  renamed ospeed "outspeed" so that it doesn't conflict with
  149.     some weird system's polution of the name space.
  150.    o    term.c:  support for the termios systems added.
  151.    o    term.c:  winch_catcher() needed an int parameter for ANSI systems.
  152.    o    util.c:  reorganized a couple returns to avoid warnings about not
  153.     returning a value in a function.
  154.    o    Configure now knows about DG Avion.
  155.  
  156. Install this patch using Larry Wall's patch program. You MUST install all
  157. three parts or you will not have a functional program.
  158.  
  159. Index: addng.c
  160. Prereq: 4.4.2.1
  161. *** addng.c    Sun Dec  1 12:08:44 1991
  162. --- ../rn4.4.3/addng.c    Sat Feb 22 21:54:59 1992
  163. ***************
  164. *** 1,6 ****
  165. ! /* $Id: addng.c,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  166.    *
  167.    * $Log: addng.c,v $
  168.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  169.    * Patchlevel 2 changes
  170.    *
  171. --- 1,9 ----
  172. ! /* $Id: addng.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  173.    *
  174.    * $Log: addng.c,v $
  175. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  176. +  * Release 4.4 Patchlevel 3
  177. +  *
  178.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  179.    * Patchlevel 2 changes
  180.    *
  181. ***************
  182. *** 38,43 ****
  183. --- 41,47 ----
  184.   #include "final.h"
  185.   #include "INTERN.h"
  186.   #include "addng.h"
  187. + #include <time.h>
  188.   
  189.   void
  190.   addng_init()
  191. ***************
  192. *** 50,76 ****
  193.   
  194.   bool
  195.   newlist(munged,checkinlist)
  196. ! bool munged;                /* are we scanning the whole file? */
  197. ! bool checkinlist;
  198.   {
  199.       char *tmpname;
  200.       register char *s, *status;
  201.       register NG_NUM ngnum;
  202.       long birthof();
  203.   
  204. !     tmpname = savestr(filexp(RNEWNAME));
  205. !     tmpfp = fopen(tmpname,"w");
  206.       if (tmpfp == Nullfp) {
  207.       printf(cantcreate,tmpname) FLUSH;
  208.       return FALSE;
  209.       }
  210.       while (fgets(buf,LBUFLEN,actfp) != Nullch) {
  211.       /* Check if they want to break out of the new newsgroups search */
  212.       if (int_count) {
  213.           int_count = 0;
  214.           fclose(tmpfp);
  215. -         UNLINK(tmpname);
  216. -         free(tmpname);
  217.           return FALSE;
  218.       }
  219.       if (s = index(buf,' ')) {
  220. --- 54,82 ----
  221.   
  222.   bool
  223.   newlist(munged,checkinlist)
  224. ! bool_int munged;            /* are we scanning the whole file? */
  225. ! bool_int checkinlist;
  226.   {
  227.       char *tmpname;
  228.       register char *s, *status;
  229.       register NG_NUM ngnum;
  230. + #ifndef ACTIVE_TIMES
  231.       long birthof();
  232. + #endif
  233.   
  234. !     tmpname = filexp(RNEWNAME);
  235. !     tmpfp = fopen(tmpname,"w+");
  236.       if (tmpfp == Nullfp) {
  237.       printf(cantcreate,tmpname) FLUSH;
  238.       return FALSE;
  239.       }
  240. +     UNLINK(tmpname);            /* be nice to the world */
  241.       while (fgets(buf,LBUFLEN,actfp) != Nullch) {
  242.       /* Check if they want to break out of the new newsgroups search */
  243.       if (int_count) {
  244.           int_count = 0;
  245.           fclose(tmpfp);
  246.           return FALSE;
  247.       }
  248.       if (s = index(buf,' ')) {
  249. ***************
  250. *** 81,92 ****
  251.               /* since = groups are refiling to another group, just
  252.              ignore their existence */
  253.           continue;
  254. ! #ifdef OLD_ADD_METHOD
  255. !         if (find_ng(buf) == nextrcline &&
  256. !             (checkinlist ?
  257. !             (inlist(buf)) :
  258. !             (birthof(buf,(ART_NUM)atol(s)) > lasttime)
  259. !             )
  260.   #else
  261.           if (checkinlist ?
  262.           (inlist(buf) && ((ngnum = find_ng(buf)) == nextrcline
  263. --- 87,95 ----
  264.               /* since = groups are refiling to another group, just
  265.              ignore their existence */
  266.           continue;
  267. ! #ifdef ACTIVE_TIMES
  268. !         if (inlist(buf) && ((ngnum = find_ng(buf)) == nextrcline
  269. !                 || toread[ngnum] == TR_UNSUB)
  270.   #else
  271.           if (checkinlist ?
  272.           (inlist(buf) && ((ngnum = find_ng(buf)) == nextrcline
  273. ***************
  274. *** 94,100 ****
  275.             : (find_ng(buf) == nextrcline
  276.            && birthof(buf,(ART_NUM)atol(s)) > lasttime)
  277.   #endif
  278. !         ) {
  279.                       /* if not in .newsrc and younger */
  280.                       /* than the last time we checked */
  281.           fprintf(tmpfp,"%s\n",buf);
  282. --- 97,103 ----
  283.             : (find_ng(buf) == nextrcline
  284.            && birthof(buf,(ART_NUM)atol(s)) > lasttime)
  285.   #endif
  286. !         ) {
  287.                       /* if not in .newsrc and younger */
  288.                       /* than the last time we checked */
  289.           fprintf(tmpfp,"%s\n",buf);
  290. ***************
  291. *** 104,111 ****
  292.           else {            /* not really a new group */
  293.           if (!munged) {        /* did we assume not munged? */
  294.               fclose(tmpfp);    /* then go back, knowing that */
  295. -             UNLINK(tmpname);
  296. -             free(tmpname);
  297.               return TRUE;    /* active file was indeed munged */
  298.           }
  299.           }
  300. --- 107,112 ----
  301. ***************
  302. *** 119,140 ****
  303.   
  304.       /* we have successfully generated the list */
  305.   
  306. !     fclose(tmpfp);
  307. !     tmpfp = fopen(tmpname,"r");
  308. !     UNLINK(tmpname);            /* be nice to the world */
  309. !     if (tmpfp == Nullfp) {
  310. !     printf(cantopen,tmpname) FLUSH;
  311. !     return FALSE;
  312. !     }
  313.       while (fgets(buf,LBUFLEN,tmpfp) != Nullch) {
  314.       buf[strlen(buf)-1] = '\0';
  315.       get_ng(buf,TRUE);        /* add newsgroup, maybe */
  316.       }
  317.       fclose(tmpfp);            /* be nice to ourselves */
  318. -     free(tmpname);
  319.       return FALSE;            /* do not call us again */
  320.   }
  321.   
  322.   /* return creation time of newsgroup */
  323.   
  324.   long
  325. --- 120,284 ----
  326.   
  327.       /* we have successfully generated the list */
  328.   
  329. !     fseek(tmpfp,0L,0);            /* rewind back to the beginning */
  330.       while (fgets(buf,LBUFLEN,tmpfp) != Nullch) {
  331.       buf[strlen(buf)-1] = '\0';
  332.       get_ng(buf,TRUE);        /* add newsgroup, maybe */
  333.       }
  334.       fclose(tmpfp);            /* be nice to ourselves */
  335.       return FALSE;            /* do not call us again */
  336.   }
  337.   
  338. + #ifdef ACTIVE_TIMES
  339. + #ifdef SERVER
  340. + bool
  341. + find_new_groups()
  342. + {
  343. +     char *tmpname;
  344. +     register char *s;
  345. +     struct tm *ts;
  346. +     long now;
  347. +     NG_NUM oldnext = nextrcline;    /* remember # lines in newsrc */
  348. +     tmpname = filexp(RNEWNAME);
  349. +     tmpfp = fopen(tmpname,"w+");
  350. +     if (tmpfp == Nullfp) {
  351. +     printf(cantcreate,tmpname) FLUSH;
  352. +     return FALSE;
  353. +     }
  354. +     UNLINK(tmpname);            /* be nice to the world */
  355. +     time(&now);
  356. +     ts = gmtime(&lastnewtime);
  357. +     sprintf(ser_line, "NEWGROUPS %02d%02d%02d %02d%02d%02d GMT",
  358. +     ts->tm_year % 100, ts->tm_mon+1, ts->tm_mday,
  359. +     ts->tm_hour, ts->tm_min, ts->tm_sec);
  360. + #ifdef DEBUGGING
  361. +     if (debug & DEB_NNTP)
  362. +     printf(">%s\n", ser_line) FLUSH;
  363. + #endif
  364. +     put_server(ser_line);
  365. +     nntp_get(ser_line, sizeof(ser_line));
  366. + #ifdef DEBUGGING
  367. +     if (debug & DEB_NNTP)
  368. +     printf("<%s\n", ser_line) FLUSH;
  369. + #endif
  370. +     if (*ser_line != CHAR_OK) {        /* and then see if that's ok */
  371. +   error_exit:
  372. +     fclose(tmpfp);
  373. +     printf("Can't get new groups from server:\n%s\n", ser_line);
  374. +     return FALSE;
  375. +     }
  376. +     while (1) {
  377. +     if (nntp_get(ser_line, sizeof(ser_line)) < 0)
  378. +         goto error_exit;
  379. + #ifdef DEBUGGING
  380. +     if (debug & DEB_NNTP)
  381. +         printf("<%s\n", ser_line) FLUSH;
  382. + #endif
  383. +     if (ser_line[0] == '.')
  384. +         break;
  385. +     if ((s = index(ser_line, ' ')) != Nullch)
  386. +         *s = '\0';
  387. +     fprintf(tmpfp,"%s\n",ser_line);
  388. +     }
  389. +     /* we have successfully generated the list */
  390. +     if (ftell(tmpfp)) {
  391. +     fputs("\nFinding new newsgroups:\n",stdout) FLUSH;
  392. +     fseek(tmpfp,0L,0);        /* rewind back to the beginning */
  393. +     while (fgets(buf,LBUFLEN,tmpfp) != Nullch) {
  394. +         buf[strlen(buf)-1] = '\0';
  395. +         get_ng(buf,FALSE);        /* add newsgroup, maybe */
  396. +     }
  397. +     lastnewtime = now;        /* remember when we found new groups */
  398. +     }                    /* (ends up back in .rnlast) */
  399. +     fclose(tmpfp);            /* be nice to ourselves */
  400. +     return oldnext != nextrcline;
  401. + }
  402. + #else /* not SERVER */
  403. + bool
  404. + find_new_groups()
  405. + {
  406. +     register char *s;
  407. +     long lastone;
  408. +     NG_NUM oldnext = nextrcline;    /* remember # lines in newsrc */
  409. +     fstat(fileno(actfp),&filestat);    /* find active file size */
  410. +     lastactsiz = filestat.st_size;    /* just to save it in .rnlast */
  411. +     stat(ACTIVE_TIMES,&filestat);    /* did active.times file grow? */
  412. +     if (filestat.st_size == lastnewsize)
  413. +     return FALSE;
  414. +     lastnewsize = filestat.st_size;
  415. +     fputs("\nChecking for new newsgroups...\n",stdout) FLUSH;
  416. +     s = filexp(ACTIVE_TIMES);
  417. +     tmpfp = fopen(s,"r");
  418. +     if (tmpfp == Nullfp) {
  419. +     printf(cantopen,s) FLUSH;
  420. +     return FALSE;
  421. +     }
  422. +     lastone = time(Null(time_t*)) - 24L * 60 * 60 - 1;
  423. +     while (fgets(buf,LBUFLEN,tmpfp) != Nullch) {
  424. +     if ((s = index(buf, ' ')) != Nullch)
  425. +         if ((lastone = atol(s+1)) >= lastnewtime) {
  426. +         char tmpbuf[80];
  427. +         *s = '\0';
  428. +         if (findact(tmpbuf, buf, s - buf, 0L) >= 0)
  429. +             get_ng(buf,FALSE);    /* add newsgroup, maybe */
  430. +         }
  431. +     }
  432. +     fclose(tmpfp);
  433. +     lastnewtime = lastone+1;        /* remember time of last new group */
  434. +                     /* (ends up back in .rnlast) */
  435. +     return oldnext != nextrcline;
  436. + }
  437. + #endif /* SERVER */
  438. + #else /* not ACTIVE_TIMES */
  439. + bool
  440. + find_new_groups()
  441. + {
  442. +     long oldactsiz = lastactsiz;
  443. +     NG_NUM oldnext = nextrcline;    /* remember # lines in newsrc */
  444. +     fstat(fileno(actfp),&filestat);    /* did active file grow? */
  445. +     if (filestat.st_size == lastactsiz)
  446. +     return FALSE;
  447. +     lastactsiz = filestat.st_size;    /* remember new size */
  448. + #ifdef VERBOSE
  449. +     IF(verbose)
  450. +     fputs("\nChecking active file for new newsgroups...\n",stdout) FLUSH;
  451. +     ELSE
  452. + #endif
  453. + #ifdef TERSE
  454. +     fputs("\nNew newsgroups:\n",stdout) FLUSH;
  455. + #endif
  456. + #ifdef FASTNEW                /* bad soft ptrs -> edited active */
  457. +     if (!writesoft && oldactsiz) {    /* maybe just do tail of file? */
  458. +     fseek(actfp,oldactsiz-NL_SIZE,0);
  459. +     fgets(buf,LBUFLEN,actfp);
  460. +     if (*buf == '\n' && !newlist(FALSE,FALSE))
  461. +         goto bugout;
  462. +     }
  463. + #endif
  464. +     fseek(actfp,0L,0);        /* rewind active file */
  465. +     newlist(TRUE,FALSE);        /* sure hope they use hashing... */
  466. + bugout:
  467. +     return oldnext != nextrcline;
  468. + }
  469.   /* return creation time of newsgroup */
  470.   
  471.   long
  472. ***************
  473. *** 146,157 ****
  474.       long time();
  475.    
  476.   #ifdef SERVER        /* ngsize not used */
  477. !     int x,tot,min,max;
  478.       sprintf(tst,"GROUP %s",ngnam);
  479.       put_server(tst);
  480.       (void) nntp_get(tst, sizeof(tst));
  481.       if (*tst != CHAR_OK) return(0); /* not a real group */
  482. !     (void) sscanf(tst,"%d%d%d%d",&x,&tot,&min,&max);
  483.       if (tot > 0) return(time(Null(long *)));
  484.       else return(0);
  485.   #else /* not SERVER */
  486. --- 290,309 ----
  487.       long time();
  488.    
  489.   #ifdef SERVER        /* ngsize not used */
  490. !     long tot;
  491.       sprintf(tst,"GROUP %s",ngnam);
  492. + #ifdef DEBUGGING
  493. +     if (debug & DEB_NNTP)
  494. +     printf(">%s\n", tst) FLUSH;
  495. + #endif
  496.       put_server(tst);
  497.       (void) nntp_get(tst, sizeof(tst));
  498. + #ifdef DEBUGGING
  499. +     if (debug & DEB_NNTP)
  500. +     printf("<%s\n", tst) FLUSH;
  501. + #endif
  502.       if (*tst != CHAR_OK) return(0); /* not a real group */
  503. !     (void) sscanf(tst,"%*d%ld",&tot);
  504.       if (tot > 0) return(time(Null(long *)));
  505.       else return(0);
  506.   #else /* not SERVER */
  507. ***************
  508. *** 165,170 ****
  509. --- 317,323 ----
  510.   
  511.   #endif
  512.   }
  513. + #endif /* ACTIVE_TIMES */
  514.   
  515.   bool
  516.   scanactive()
  517. Index: addng.h
  518. Prereq: 4.4
  519. *** addng.h    Sat Nov  9 14:41:36 1991
  520. --- ../rn4.4.3/addng.h    Sat Feb 22 21:54:04 1992
  521. ***************
  522. *** 1,6 ****
  523. ! /* $Id: addng.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  524.    *
  525.    * $Log: addng.h,v $
  526.    * Revision 4.4  1991/09/09  20:18:23  sob
  527.    * release 4.4
  528.    *
  529. --- 1,9 ----
  530. ! /* $Id: addng.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  531.    *
  532.    * $Log: addng.h,v $
  533. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  534. +  * Release 4.4 Patchlevel 3
  535. +  *
  536.    * Revision 4.4  1991/09/09  20:18:23  sob
  537.    * release 4.4
  538.    *
  539. ***************
  540. *** 22,28 ****
  541.   
  542.   void    addng_init ANSI((void));
  543.   #ifdef FINDNEWNG
  544. !     bool    newlist ANSI((bool,bool));
  545.       long    birthof ANSI((char *,ART_NUM));
  546.       bool    scanactive ANSI((void));
  547.   #endif
  548. --- 25,35 ----
  549.   
  550.   void    addng_init ANSI((void));
  551.   #ifdef FINDNEWNG
  552. !     bool    newlist ANSI((bool_int,bool_int));
  553. ! # ifdef ACTIVE_TIMES
  554. !     bool    find_new_groups ANSI((void));
  555. ! # else
  556.       long    birthof ANSI((char *,ART_NUM));
  557. + # endif
  558.       bool    scanactive ANSI((void));
  559.   #endif
  560. Index: art.c
  561. Prereq: 4.4.2.1
  562. *** art.c    Sun Dec  1 12:08:47 1991
  563. --- ../rn4.4.3/art.c    Sat Feb 22 21:54:38 1992
  564. ***************
  565. *** 1,4 ****
  566. ! /* $Id: art.c,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  567.    *
  568.    *
  569.    * 
  570. --- 1,4 ----
  571. ! /* $Id: art.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  572.    *
  573.    *
  574.    * 
  575. ***************
  576. *** 97,103 ****
  577.       register int outputok;
  578.   #endif
  579.   
  580. - /*  if (fstat(artfp->_file,&filestat)) ... does not work on Apollos */
  581.       if (fstat(fileno(artfp),&filestat))
  582.                   /* get article file stats */
  583.       return DA_CLEAN;
  584. --- 97,102 ----
  585. ***************
  586. *** 225,231 ****
  587.   #endif
  588.           if (in_header && htype[in_header].ht_flags & HT_MAGIC) {
  589.           if (in_header == NGS_LINE) {
  590. !             hide_this_line = (index(art_buf,',') == Nullch);
  591.           }
  592.           else if (in_header == EXPIR_LINE) {
  593.               if (!(htype[EXPIR_LINE].ht_flags & HT_HIDE))
  594. --- 224,235 ----
  595.   #endif
  596.           if (in_header && htype[in_header].ht_flags & HT_MAGIC) {
  597.           if (in_header == NGS_LINE) {
  598. !             if ((s = index(art_buf,'\n')) != Nullch)
  599. !             *s = '\0';
  600. !             hide_this_line = (index(art_buf,',') == Nullch)
  601. !             && strEQ(art_buf+12, ngname);
  602. !             if (s != Nullch)
  603. !             *s = '\n';
  604.           }
  605.           else if (in_header == EXPIR_LINE) {
  606.               if (!(htype[EXPIR_LINE].ht_flags & HT_HIDE))
  607. Index: artio.c
  608. Prereq: 4.4
  609. *** artio.c    Sat Nov  9 14:42:30 1991
  610. --- ../rn4.4.3/artio.c    Sat Feb 22 21:55:08 1992
  611. ***************
  612. *** 1,6 ****
  613. ! /* $Id: artio.c,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  614.    *
  615.    * $Log: artio.c,v $
  616.    * Revision 4.4  1991/09/09  20:18:23  sob
  617.    * release 4.4
  618.    *
  619. --- 1,9 ----
  620. ! /* $Id: artio.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  621.    *
  622.    * $Log: artio.c,v $
  623. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  624. +  * Release 4.4 Patchlevel 3
  625. +  *
  626.    * Revision 4.4  1991/09/09  20:18:23  sob
  627.    * release 4.4
  628.    *
  629. ***************
  630. *** 130,140 ****
  631. --- 133,151 ----
  632.           sprintf(ser_line, "ARTICLE %ld", (long)artnum);
  633.           break;
  634.       }        
  635. + #ifdef DEBUGGING
  636. +     if (debug & DEB_NNTP)
  637. +     printf(">%s\n", ser_line) FLUSH;
  638. + #endif
  639.       put_server(ser_line);        /* ask the server for the article */
  640.       if (nntp_get(ser_line, sizeof(ser_line)) < 0) {
  641.       fprintf(stderr, "\nrrn: Unexpected close of server socket.\n");
  642.       finalize(1);
  643.       }
  644. + #ifdef DEBUGGING
  645. +     if (debug & DEB_NNTP)
  646. +     printf("<%s\n", ser_line) FLUSH;
  647. + #endif
  648.       if (*ser_line == CHAR_FATAL) {    /* Fatal error */
  649.           fprintf(stderr,"\nrrn: %s\n",ser_line);
  650.           finalize(1);
  651. Index: artsrch.c
  652. Prereq: 4.4.2.1
  653. *** artsrch.c    Sun Dec  1 12:08:58 1991
  654. --- ../rn4.4.3/artsrch.c    Sat Feb 22 21:55:00 1992
  655. ***************
  656. *** 1,6 ****
  657. ! /* $Id: artsrch.c,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  658.    *
  659.    * $Log: artsrch.c,v $
  660.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  661.    * Patchlevel 2 changes
  662.    *
  663. --- 1,9 ----
  664. ! /* $Id: artsrch.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  665.    *
  666.    * $Log: artsrch.c,v $
  667. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  668. +  * Release 4.4 Patchlevel 3
  669. +  *
  670.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  671.    * Patchlevel 2 changes
  672.    *
  673. ***************
  674. *** 275,281 ****
  675.   wanted(compex, artnum, scope)
  676.   COMPEX *compex;
  677.   ART_NUM artnum;
  678. ! char scope;
  679.   {
  680.       if (!scope) {
  681.       char subj_buf[266];
  682. --- 278,284 ----
  683.   wanted(compex, artnum, scope)
  684.   COMPEX *compex;
  685.   ART_NUM artnum;
  686. ! char_int scope;
  687.   {
  688.       if (!scope) {
  689.       char subj_buf[266];
  690. Index: artsrch.h
  691. Prereq: 4.4
  692. *** artsrch.h    Sat Nov  9 14:41:28 1991
  693. --- ../rn4.4.3/artsrch.h    Sat Feb 22 21:53:56 1992
  694. ***************
  695. *** 1,6 ****
  696. ! /* $Id: artsrch.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  697.    *
  698.    * $Log: artsrch.h,v $
  699.    * Revision 4.4  1991/09/09  20:18:23  sob
  700.    * release 4.4
  701.    *
  702. --- 1,9 ----
  703. ! /* $Id: artsrch.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  704.    *
  705.    * $Log: artsrch.h,v $
  706. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  707. +  * Release 4.4 Patchlevel 3
  708. +  *
  709.    * Revision 4.4  1991/09/09  20:18:23  sob
  710.    * release 4.4
  711.    *
  712. ***************
  713. *** 50,55 ****
  714.   void    artsrch_init ANSI((void));
  715.   #ifdef ARTSEARCH
  716.       int        art_search ANSI((char *, int, int));
  717. !     bool    wanted ANSI((COMPEX *, ART_NUM, char));
  718.               /* return TRUE if current article matches pattern */
  719.   #endif
  720. --- 53,58 ----
  721.   void    artsrch_init ANSI((void));
  722.   #ifdef ARTSEARCH
  723.       int        art_search ANSI((char *, int, int));
  724. !     bool    wanted ANSI((COMPEX *, ART_NUM, char_int));
  725.               /* return TRUE if current article matches pattern */
  726.   #endif
  727. Index: autosub.c
  728. Prereq: 4.4
  729. *** autosub.c    Sat Nov  9 14:42:44 1991
  730. --- ../rn4.4.3/autosub.c    Sat Feb 22 21:53:54 1992
  731. ***************
  732. *** 1,7 ****
  733.   /*
  734. !  * $Id: autosub.c,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  735.    *
  736.    * $Log: autosub.c,v $
  737.    * Revision 4.4  1991/09/09  20:18:23  sob
  738.    * release 4.4
  739.    *
  740. --- 1,10 ----
  741.   /*
  742. !  * $Id: autosub.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  743.    *
  744.    * $Log: autosub.c,v $
  745. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  746. +  * Release 4.4 Patchlevel 3
  747. +  *
  748.    * Revision 4.4  1991/09/09  20:18:23  sob
  749.    * release 4.4
  750.    *
  751. ***************
  752. *** 23,30 ****
  753.   
  754.   #include "EXTERN.h"
  755.   #include "common.h"
  756. - #include "ngsrch.h"
  757.   #include "search.h"
  758.   #include "util.h"
  759.   #include "INTERN.h"
  760.   #include "autosub.h"
  761. --- 26,33 ----
  762.   
  763.   #include "EXTERN.h"
  764.   #include "common.h"
  765.   #include "search.h"
  766. + #include "ngsrch.h"
  767.   #include "util.h"
  768.   #include "INTERN.h"
  769.   #include "autosub.h"
  770. Index: bits.c
  771. Prereq: 4.4
  772. *** bits.c    Sat Nov  9 14:42:07 1991
  773. --- ../rn4.4.3/bits.c    Sat Feb 22 21:54:46 1992
  774. ***************
  775. *** 1,6 ****
  776. ! /* $Id: bits.c,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  777.    *
  778.    * $Log: bits.c,v $
  779.    * Revision 4.4  1991/09/09  20:18:23  sob
  780.    * release 4.4
  781.    *
  782. --- 1,9 ----
  783. ! /* $Id: bits.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  784.    *
  785.    * $Log: bits.c,v $
  786. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  787. +  * Release 4.4 Patchlevel 3
  788. +  *
  789.    * Revision 4.4  1991/09/09  20:18:23  sob
  790.    * release 4.4
  791.    *
  792. ***************
  793. *** 397,403 ****
  794.           free(inews_site);
  795.   #ifndef NORELAY
  796.           rver_buf = fetchlines(artnum,RVER_LINE);
  797. !         if ((t = instr(rver_buf,"; site "), TRUE) == Nullch)
  798.   #else /* NORELAY */
  799.             /* In version 2.10.3 of news or afterwards, the Relay-Version
  800.              * and Posting-Version header lines have been removed.  For
  801. --- 400,406 ----
  802.           free(inews_site);
  803.   #ifndef NORELAY
  804.           rver_buf = fetchlines(artnum,RVER_LINE);
  805. !         if ((t = instr(rver_buf,"; site ", TRUE)) == Nullch)
  806.   #else /* NORELAY */
  807.             /* In version 2.10.3 of news or afterwards, the Relay-Version
  808.              * and Posting-Version header lines have been removed.  For
  809. Index: common.h
  810. Prereq: 4.4.2.1
  811. *** common.h    Sun Dec  1 12:10:08 1991
  812. --- ../rn4.4.3/common.h    Sat Feb 22 21:54:31 1992
  813. ***************
  814. *** 1,6 ****
  815. ! /* $Id: common.h,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  816.    * 
  817.    * $Log: common.h,v $
  818.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  819.    * Patchlevel 2 changes
  820.    *
  821. --- 1,9 ----
  822. ! /* $Id: common.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  823.    * 
  824.    * $Log: common.h,v $
  825. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  826. +  * Release 4.4 Patchlevel 3
  827. +  *
  828.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  829.    * Patchlevel 2 changes
  830.    *
  831. ***************
  832. *** 52,58 ****
  833. --- 55,65 ----
  834.   #ifdef TERMIO
  835.   #   include <termio.h>
  836.   #else
  837. + # ifdef TERMIOS
  838. + #   include <termios.h>
  839. + # else
  840.   #   include <sgtty.h>
  841. + # endif
  842.   #endif
  843.   
  844.   #ifdef GETPWENT
  845. ***************
  846. *** 89,94 ****
  847. --- 96,103 ----
  848.   /* some handy defs */
  849.   
  850.   #define bool char
  851. + #define bool_int int
  852. + #define char_int int
  853.   #ifndef TRUE
  854.   #define TRUE (1)
  855.   #endif
  856. ***************
  857. *** 148,154 ****
  858.    *    %I    Inclusion indicator
  859.    *    %l    News administrator login name
  860.    *    %L    Login name (yours)
  861. !  *    %M    Number of articles markd with M
  862.    *    %n    Newsgroups from source article
  863.    *    %N    Full name (yours)
  864.    *    %o    Organization (yours)
  865. --- 157,163 ----
  866.    *    %I    Inclusion indicator
  867.    *    %l    News administrator login name
  868.    *    %L    Login name (yours)
  869. !  *    %M    Number of articles marked with M
  870.    *    %n    Newsgroups from source article
  871.    *    %N    Full name (yours)
  872.    *    %o    Organization (yours)
  873. ***************
  874. *** 718,724 ****
  875.   
  876.   /* what to do with ansi prototypes -- '()' == ignore, 'x' == use */
  877.   #ifndef ANSI
  878. ! #   define ANSI(x) ()
  879.   #endif
  880.   
  881.   /* how many characters is a newline in a text file? */
  882. --- 727,737 ----
  883.   
  884.   /* what to do with ansi prototypes -- '()' == ignore, 'x' == use */
  885.   #ifndef ANSI
  886. ! #   ifdef __STDC__
  887. ! #    define ANSI(x) x
  888. ! #   else
  889. ! #    define ANSI(x) ()
  890. ! #   endif
  891.   #endif
  892.   
  893.   /* how many characters is a newline in a text file? */
  894. ***************
  895. *** 775,780 ****
  896. --- 788,794 ----
  897.   
  898.   #ifdef DEBUGGING
  899.       EXT int debug INIT(0);                /* -D */
  900. + #   define DEB_NNTP 16 
  901.   #   define DEB_INNERSRCH 32 
  902.   #   define DEB_FILEXP 64 
  903.   #   define DEB_HASH 128
  904. ***************
  905. *** 839,845 ****
  906.   extern errno;
  907.   /* Factored strings */
  908.   
  909. ! EXT char nullstr[] INIT("");
  910.   EXT char sh[] INIT(SH);
  911.   EXT char defeditor[] INIT(DEFEDITOR);
  912.   EXT char hforhelp[] INIT("Type h for help.\n");
  913. --- 853,859 ----
  914.   extern errno;
  915.   /* Factored strings */
  916.   
  917. ! EXT char nullstr[1] INIT("");
  918.   EXT char sh[] INIT(SH);
  919.   EXT char defeditor[] INIT(DEFEDITOR);
  920.   EXT char hforhelp[] INIT("Type h for help.\n");
  921. ***************
  922. *** 850,855 ****
  923. --- 864,870 ----
  924.   EXT char unsubto[] INIT("\n\nUnsubscribed to newsgroup %s\n");
  925.   EXT char cantopen[] INIT("Can't open %s\n");
  926.   EXT char cantcreate[] INIT("Can't create %s\n");
  927. + EXT char cantrecreate[] INIT("Can't recreate %s -- restoring older version.\n");
  928.   
  929.   #ifdef VERBOSE
  930.       EXT char nocd[] INIT("Can't chdir to directory %s\n");
  931. Index: config.h.SH
  932. Prereq: 4.4.2.1
  933. *** config.h.SH    Sun Dec  1 12:08:04 1991
  934. --- ../rn4.4.3/config.h.SH    Sat Feb 22 21:55:06 1992
  935. ***************
  936. *** 1,7 ****
  937.   : create config.h file
  938.   echo "Extracting config.h (with variable substitutions)"
  939. ! . ./config.sh
  940.   case "$hostfile" in
  941.   '')    usehostfile='undef';;
  942.   *)    usehostfile='define';;
  943. --- 1,12 ----
  944.   : create config.h file
  945. + case $CONFIG in
  946. +     '') . ./config.sh ;;
  947. + esac
  948.   echo "Extracting config.h (with variable substitutions)"
  949. ! case "$activetimes" in
  950. ! 'none')    acttimes='undef';;
  951. ! *)    acttimes='define';;
  952. ! esac
  953.   case "$hostfile" in
  954.   '')    usehostfile='undef';;
  955.   *)    usehostfile='define';;
  956. ***************
  957. *** 16,31 ****
  958.    * Feel free to modify any of this as the need arises.  Note, however,
  959.    * that running config.h.SH again will wipe out any changes you've made.
  960.    * For a more permanent change edit config.sh and rerun config.h.SH.
  961. !  * $Id: config.h.SH,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  962.    *
  963.    * $Log: config.h.SH,v $
  964. ! # Revision 4.4.2.1  1991/12/01  18:05:42  sob
  965. ! # Fixed problems with CTRLA flag.
  966. ! #
  967. ! # Revision 4.4  1991/09/09  20:18:23  sob
  968. ! # release 4.4
  969. ! #
  970.    *
  971.    * 
  972.    */
  973.   /* This software is Copyright 1991 by Stan Barber. 
  974. --- 21,39 ----
  975.    * Feel free to modify any of this as the need arises.  Note, however,
  976.    * that running config.h.SH again will wipe out any changes you've made.
  977.    * For a more permanent change edit config.sh and rerun config.h.SH.
  978. !  * $Id: config.h.SH,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  979.    *
  980.    * $Log: config.h.SH,v $
  981. !  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  982. !  *Release 4.4 Patchlevel 3
  983. !  *
  984. !  * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  985. !  * Fixed problems with CTRLA flag.
  986. !  *
  987. !  * Revision 4.4  1991/09/09  20:18:23  sob
  988. !  * release 4.4
  989.    *
  990. +  *
  991.    * 
  992.    */
  993.   /* This software is Copyright 1991 by Stan Barber. 
  994. ***************
  995. *** 43,49 ****
  996.   
  997.   /* name of the site.  May be overridden by HOSTFILE, gethostname, uname, etc. */
  998.   #define SITENAME "$sitename"
  999. ! #$usehostfile HOSTFILE "$hostfile"    /* */
  1000.   
  1001.   /* domain name for the site */
  1002.   #define OURDOMAIN "$domain"
  1003. --- 51,57 ----
  1004.   
  1005.   /* name of the site.  May be overridden by HOSTFILE, gethostname, uname, etc. */
  1006.   #define SITENAME "$sitename"
  1007. ! #$usehostfile HOSTFILE "$hostfile"    /* defined if we read the hostname from a file */
  1008.   
  1009.   /* domain name for the site */
  1010.   #define OURDOMAIN "$domain"
  1011. ***************
  1012. *** 51,58 ****
  1013.   /* name of the organization, may be a file name */
  1014.   #define ORGNAME "$orgname"
  1015.   
  1016.   /* login name of news administrator, if any. */
  1017. ! #$isadmin NEWSADMIN "$newsadmin"
  1018.   
  1019.   /* news library, may use only ~ and %l expansion */
  1020.   #define LIB "$lib"
  1021. --- 59,69 ----
  1022.   /* name of the organization, may be a file name */
  1023.   #define ORGNAME "$orgname"
  1024.   
  1025. + /* ignore the ORGANIZATION environment variable */
  1026. + #$ignoreorg IGNOREORG        /**/
  1027.   /* login name of news administrator, if any. */
  1028. ! #$isadmin NEWSADMIN "$newsadmin"    /**/
  1029.   
  1030.   /* news library, may use only ~ and %l expansion */
  1031.   #define LIB "$lib"
  1032. ***************
  1033. *** 66,71 ****
  1034. --- 77,85 ----
  1035.   /* location of the active file, may use ~ expansion, %x and %l */
  1036.   #define ACTIVE "$active"
  1037.   
  1038. + /* define where the active.times file is kept if we're using it */
  1039. + #$acttimes ACTIVE_TIMES "$activetimes"    /* including name */
  1040.   /* location of spooled mail */
  1041.   #define MAILFILE "$maildir"
  1042.   
  1043. ***************
  1044. *** 85,145 ****
  1045.   #define CANCEL "$inews -h <%h"
  1046.   
  1047.   /* distribution groups */
  1048. ! #define LOCDIST "$locpref"
  1049. ! #define ORGDIST "$orgpref"
  1050. ! #define CITYDIST "$citypref"
  1051.   #define STATEDIST "$statepref"
  1052.   #define CNTRYDIST "$cntrypref"
  1053. ! #define CONTDIST "$contpref"
  1054.   
  1055. ! #$strchr index   strchr    /* cultural */
  1056. ! #$strchr rindex  strrchr    /*  differences? */
  1057. ! #$memcpy bcopy(s,d,n)    memcpy((char*)d,(char*)s,(int)n)    /* Different */
  1058. ! #$memcpy bzero(d,n)    memset((char*)d,0,(int)n)        /*  flavors. */
  1059. ! #$rename    RENAME        /* is rename() a system call? */
  1060. ! #$truncate    TRUNCATE    /* is truncate() available? */
  1061. ! #$chsize    CHSIZE        /* is chsize() available? */
  1062. ! #$tzset    TZSET        /* modern timezone functions? */
  1063.   #$novoid void int    /* is void to be avoided? */
  1064.   #$novfork vfork fork    /* is vfork too virtual? */
  1065. ! #$sunos4    SUNOS4        /* running SunOS 4.X? */
  1066. ! #$eunice    EUNICE        /* no linking? */
  1067. ! #$eunice    VMS        /* not currently used, here just in case */
  1068. ! #$getcwd    GETCWD        /* do we have getcwd()? */
  1069. ! #$getwd        GETWD        /* do we have getwd()? */
  1070. ! #$usendir    USENDIR        /* include ndir.c? */
  1071. ! #$libndir    LIBNDIR        /* include /usr/include/ndir.h? */
  1072. ! #define    DIRTYPE   $dirtype
  1073.   #ifndef USENDIR
  1074. ! #define    DIRINC      $dirinc
  1075.   #endif
  1076. ! #$mininact    MININACT    /* include 2.10.2 optimization? */
  1077. ! #$portable    PORTABLE    /* do we do extra lookups to start up? */
  1078. ! #$passnam    PASSNAMES    /* do names come from the passwd file? */
  1079.               /*  (undef to take name from ~/.fullname) */
  1080. ! #$berknam    BERKNAMES    /* if so, are they Berkeley format? */
  1081.               /* (that is, ":name,stuff:") */
  1082. ! #$usgnam    USGNAMES    /* or are they USG format? */
  1083.               /* (that is, ":stuff-name(stuff):") */
  1084. ! #$whoami    WHOAMI        /* should we include whoami.h? */
  1085. ! #$rdchk    RDCHK        /* do we have rdchk()? */
  1086. ! #$termio    TERMIO        /* is this a termio system? */
  1087. ! #$fcntl    FCNTL        /* should we include fcntl.h? */
  1088. ! #$ioctl    IOCTL        /* are ioctl args all defined in one place? */
  1089. ! #$ptem        PTEM        /* has the ptem.h include file ? */
  1090. ! #$normsig    NORMSIG        /* use signal rather than sigset? */
  1091. ! #$sigblock    SIGBLOCK    /* use sigblock and sigsetmask */
  1092. ! #$sighold    HAVESIGHOLD    /* use sighold and sigrelse */
  1093. ! #define    SIGRET    $sigret    /* what does signal() return? */
  1094. ! #$havetlib    HAVETERMLIB    /* do we have termlib-style routines? */
  1095. ! #$getuidgid    GETUIDGID    /* allow setuid (if possible) */
  1096. ! #$getpwent    GETPWENT    /* should we include getpwent? */
  1097. ! #$internet    INTERNET    /* does our mailer do INTERNET addressing? */
  1098. ! #$gethostname    GETHOSTNAME    /* do we have a gethostname function? */
  1099. ! #$douname    DOUNAME        /* do we have a uname function? */
  1100. ! #$phostname    PHOSTNAME "$hostcmd"    /* how to get host name with popen */
  1101. ! #$norelay    NORELAY        /* 2.10.3 doesn't have Relay-Version line */
  1102. ! #$isrrn    SERVER        /* rrn server code */
  1103. ! #$isrrn    SERVER_FILE    "$serverfile"    /* news server file */
  1104.   EOT
  1105. --- 99,159 ----
  1106.   #define CANCEL "$inews -h <%h"
  1107.   
  1108.   /* distribution groups */
  1109. ! #define LOCDIST   "$locpref"
  1110. ! #define ORGDIST   "$orgpref"
  1111. ! #define CITYDIST  "$citypref"
  1112.   #define STATEDIST "$statepref"
  1113.   #define CNTRYDIST "$cntrypref"
  1114. ! #define CONTDIST  "$contpref"
  1115.   
  1116. ! #$strchr index  strchr        /* cultural */
  1117. ! #$strchr rindex strrchr        /*  differences? */
  1118. ! #$memcpy bcopy(s,d,n) memcpy((char*)d,(char*)s,(int)n)    /* Different */
  1119. ! #$memcpy bzero(d,n)   memset((char*)d,0,(int)n)        /*  flavors. */
  1120. ! #$rename RENAME        /* is rename() a system call? */
  1121. ! #$truncate TRUNCATE    /* is truncate() available? */
  1122. ! #$chsize CHSIZE        /* is chsize() available? */
  1123. ! #$tzset TZSET        /* modern timezone functions? */
  1124.   #$novoid void int    /* is void to be avoided? */
  1125.   #$novfork vfork fork    /* is vfork too virtual? */
  1126. ! #$sunos4 SUNOS4        /* running SunOS 4.X? */
  1127. ! #$eunice EUNICE        /* no linking? */
  1128. ! #$eunice VMS        /* not currently used, here just in case */
  1129. ! #$getcwd GETCWD        /* do we have getcwd()? */
  1130. ! #$getwd GETWD        /* do we have getwd()? */
  1131. ! #$usendir USENDIR     /* include ndir.c? */
  1132. ! #$libndir LIBNDIR     /* include /usr/include/ndir.h? */
  1133. ! #define DIRTYPE $dirtype
  1134.   #ifndef USENDIR
  1135. ! #define DIRINC $dirinc
  1136.   #endif
  1137. ! #$mininact MININACT    /* include 2.10.2 optimization? */
  1138. ! #$portable PORTABLE    /* do we do extra lookups to start up? */
  1139. ! #$passnam PASSNAMES    /* do names come from the passwd file? */
  1140.               /*  (undef to take name from ~/.fullname) */
  1141. ! #$berknam BERKNAMES    /* if so, are they Berkeley format? */
  1142.               /* (that is, ":name,stuff:") */
  1143. ! #$usgnam USGNAMES    /* or are they USG format? */
  1144.               /* (that is, ":stuff-name(stuff):") */
  1145. ! #$whoami WHOAMI        /* should we include whoami.h? */
  1146. ! #$rdchk RDCHK        /* do we have rdchk()? */
  1147. ! #$termio TERMIO        /* is this a termio system? */
  1148. ! #$termios TERMIOS     /* is this a termios system? */
  1149. ! #$fcntl FCNTL        /* should we include fcntl.h? */
  1150. ! #$ioctl IOCTL        /* are ioctl args all defined in one place? */
  1151. ! #$ptem PTEM        /* has the ptem.h include file ? */
  1152. ! #$normsig NORMSIG     /* use signal rather than sigset? */
  1153. ! #$sigblock SIGBLOCK    /* use sigblock and sigsetmask */
  1154. ! #$sighold HAVESIGHOLD    /* use sighold and sigrelse */
  1155. ! #define SIGRET $sigret    /* what does signal() return? */
  1156. ! #$havetlib HAVETERMLIB    /* do we have termlib-style routines? */
  1157. ! #$getuidgid GETUIDGID    /* allow setuid (if possible) */
  1158. ! #$getpwent GETPWENT    /* should we include getpwent? */
  1159. ! #$internet INTERNET    /* does our mailer do INTERNET addressing? */
  1160. ! #$gethostname GETHOSTNAME    /* do we have a gethostname function? */
  1161. ! #$douname DOUNAME     /* do we have a uname function? */
  1162. ! #$phostname PHOSTNAME "$hostcmd"    /* how to get host name with popen */
  1163. ! #$norelay NORELAY     /* 2.10.3 doesn't have Relay-Version line */
  1164. ! #$isrrn SERVER        /* rrn server code */
  1165. ! #$isrrn SERVER_FILE "$serverfile"    /* news server file */
  1166.   EOT
  1167. Index: final.c
  1168. Prereq: 4.4.2.1
  1169. *** final.c    Sun Dec  1 12:09:11 1991
  1170. --- ../rn4.4.3/final.c    Sat Feb 22 21:55:07 1992
  1171. ***************
  1172. *** 1,6 ****
  1173. ! /* $Id: final.c,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  1174.    *
  1175.    * $Log: final.c,v $
  1176.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  1177.    * Patchlevel 2 changes
  1178.    *
  1179. --- 1,9 ----
  1180. ! /* $Id: final.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1181.    *
  1182.    * $Log: final.c,v $
  1183. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1184. +  * Release 4.4 Patchlevel 3
  1185. +  *
  1186.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  1187.    * Patchlevel 2 changes
  1188.    *
  1189. ***************
  1190. *** 34,42 ****
  1191. --- 37,52 ----
  1192.   #include "rcstuff.h"
  1193.   #include "ngdata.h"
  1194.   #include "artio.h"
  1195. + #ifdef SERVER
  1196. + #include "server.h"
  1197. + #endif
  1198.   #include "INTERN.h"
  1199.   #include "final.h"
  1200.   
  1201. + #ifndef sigmask
  1202. + #define sigmask(m)    (1 << ((m)-1))
  1203. + #endif
  1204.   void
  1205.   final_init()
  1206.   {
  1207. ***************
  1208. *** 104,109 ****
  1209. --- 114,122 ----
  1210.       if (status < 0) {
  1211.       chdir("/usr/tmp");
  1212.       sigset(SIGILL,SIG_DFL);
  1213. + #ifdef SIGBLOCK
  1214. +     sigsetmask(sigblock(0) & ~(sigmask(SIGILL) | sigmask(SIGIOT)));
  1215. + #endif
  1216.       abort();
  1217.       }
  1218.       exit(status);
  1219. ***************
  1220. *** 112,118 ****
  1221.   /* come here on interrupt */
  1222.   
  1223.   SIGRET
  1224. ! int_catcher()
  1225.   {
  1226.       sigset(SIGINT,int_catcher);
  1227.   #ifdef DEBUGGING
  1228. --- 125,132 ----
  1229.   /* come here on interrupt */
  1230.   
  1231.   SIGRET
  1232. ! int_catcher(dummy)
  1233. ! int dummy;
  1234.   {
  1235.       sigset(SIGINT,int_catcher);
  1236.   #ifdef DEBUGGING
  1237. ***************
  1238. *** 132,137 ****
  1239. --- 146,152 ----
  1240.   
  1241.   SIGRET
  1242.   sig_catcher(signo)
  1243. + int signo;
  1244.   {
  1245.   #ifdef VERBOSE
  1246.       static char *signame[] = {
  1247. ***************
  1248. *** 176,183 ****
  1249.       finalize(-1);
  1250.       }
  1251.   #endif
  1252. !     if (panic)
  1253.       abort();
  1254.       (void) sigset(SIGILL,SIG_DFL);
  1255.       panic = TRUE;            /* disable terminal I/O */
  1256.       if (doing_ng) {            /* need we reconstitute rc line? */
  1257. --- 191,202 ----
  1258.       finalize(-1);
  1259.       }
  1260.   #endif
  1261. !     if (panic) {
  1262. ! #ifdef SIGBLOCK
  1263. !       sigsetmask(sigblock(0) & ~(sigmask(SIGILL) | sigmask(SIGIOT)));
  1264. ! #endif
  1265.       abort();
  1266. +       }
  1267.       (void) sigset(SIGILL,SIG_DFL);
  1268.       panic = TRUE;            /* disable terminal I/O */
  1269.       if (doing_ng) {            /* need we reconstitute rc line? */
  1270. Index: final.h
  1271. Prereq: 4.4
  1272. *** final.h    Sat Nov  9 14:41:30 1991
  1273. --- ../rn4.4.3/final.h    Sat Feb 22 21:53:57 1992
  1274. ***************
  1275. *** 1,6 ****
  1276. ! /* $Id: final.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1277.    * 
  1278.    * $Log: final.h,v $
  1279.    * Revision 4.4  1991/09/09  20:18:23  sob
  1280.    * release 4.4
  1281.    *
  1282. --- 1,9 ----
  1283. ! /* $Id: final.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1284.    * 
  1285.    * $Log: final.h,v $
  1286. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1287. +  * Release 4.4 Patchlevel 3
  1288. +  *
  1289.    * Revision 4.4  1991/09/09  20:18:23  sob
  1290.    * release 4.4
  1291.    *
  1292. ***************
  1293. *** 35,41 ****
  1294.   
  1295.   /* signal catching routines */
  1296.   
  1297. ! SIGRET    int_catcher ANSI((void));
  1298.   SIGRET    sig_catcher ANSI((int));
  1299.   #ifdef SIGTSTP
  1300.    SIGRET    stop_catcher ANSI((int));
  1301. --- 38,44 ----
  1302.   
  1303.   /* signal catching routines */
  1304.   
  1305. ! SIGRET    int_catcher ANSI((int));
  1306.   SIGRET    sig_catcher ANSI((int));
  1307.   #ifdef SIGTSTP
  1308.    SIGRET    stop_catcher ANSI((int));
  1309. Index: head.c
  1310. Prereq: 4.4
  1311. *** head.c    Sat Nov  9 14:42:18 1991
  1312. --- ../rn4.4.3/head.c    Sat Feb 22 21:54:59 1992
  1313. ***************
  1314. *** 1,6 ****
  1315. ! /* $Id: head.c,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1316.    *
  1317.    * $Log: head.c,v $
  1318.    * Revision 4.4  1991/09/09  20:18:23  sob
  1319.    * release 4.4
  1320.    *
  1321. --- 1,9 ----
  1322. ! /* $Id: head.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1323.    *
  1324.    * $Log: head.c,v $
  1325. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1326. +  * Release 4.4 Patchlevel 3
  1327. +  *
  1328.    * Revision 4.4  1991/09/09  20:18:23  sob
  1329.    * release 4.4
  1330.    *
  1331. ***************
  1332. *** 46,51 ****
  1333. --- 49,55 ----
  1334.   }
  1335.   
  1336.   #ifdef DEBUGGING
  1337. + void
  1338.   dumpheader(where)
  1339.   char *where;
  1340.   {
  1341. ***************
  1342. *** 194,201 ****
  1343.   char *
  1344.   fetchsubj(artnum,current_subject,copy)
  1345.   ART_NUM artnum;                /* article to get subject from */
  1346. ! bool current_subject;            /* is it in a parsed header? */
  1347. ! bool copy;                /* do you want it savestr()ed? */
  1348.   {
  1349.       char *s = Nullch, *t;
  1350.   #ifdef SERVER
  1351. --- 198,205 ----
  1352.   char *
  1353.   fetchsubj(artnum,current_subject,copy)
  1354.   ART_NUM artnum;                /* article to get subject from */
  1355. ! bool_int current_subject;        /* is it in a parsed header? */
  1356. ! bool_int copy;                /* do you want it savestr()ed? */
  1357.   {
  1358.       char *s = Nullch, *t;
  1359.   #ifdef SERVER
  1360. ***************
  1361. *** 234,240 ****
  1362. --- 238,252 ----
  1363.           if (xhdr) {
  1364.               sprintf(ser_line, "XHDR subject %ld", artnum);
  1365.               put_server(ser_line);
  1366. + #ifdef DEBUGGING
  1367. +         if (debug & DEB_NNTP)
  1368. +             printf(">%s\n", ser_line) FLUSH;
  1369. + #endif
  1370.           if (nntp_get(ser_line, sizeof (ser_line)) >= 0) {
  1371. + #ifdef DEBUGGING
  1372. +             if (debug & DEB_NNTP)
  1373. +                 printf("<%s\n", ser_line) FLUSH;
  1374. + #endif
  1375.               if (ser_line[0] == CHAR_FATAL) {
  1376.                   fprintf(stderr,"\nrrn: %s\n",ser_line);
  1377.                   finalize(1);
  1378. ***************
  1379. *** 241,246 ****
  1380. --- 253,262 ----
  1381.   /*                xhdr = 0; */
  1382.               } else {
  1383.                   while (nntp_get(ser_line, sizeof (ser_line)) >= 0) {
  1384. + #ifdef DEBUGGING
  1385. +                 if (debug & DEB_NNTP)
  1386. +                     printf("<%s\n", ser_line) FLUSH;
  1387. + #endif
  1388.                   if (ser_line[0] == '.')
  1389.                       break;
  1390.                   else {
  1391. ***************
  1392. *** 263,268 ****
  1393. --- 279,288 ----
  1394.           if (!xhdr) {
  1395.           sprintf(ser_line, "HEAD %ld", artnum);
  1396.           put_server(ser_line);
  1397. + #ifdef DEBUGGING
  1398. +         if (debug & DEB_NNTP)
  1399. +             printf(">%s\n", ser_line) FLUSH;
  1400. + #endif
  1401.           eoo = 0;
  1402.           if (nntp_get(ser_line, sizeof (ser_line)) >= 0 && 
  1403.               ser_line[0] == CHAR_OK) {
  1404. Index: head.h
  1405. Prereq: 4.4
  1406. *** head.h    Sat Nov  9 14:43:50 1991
  1407. --- ../rn4.4.3/head.h    Sat Feb 22 21:55:09 1992
  1408. ***************
  1409. *** 1,6 ****
  1410. ! /* $Id: head.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1411.    *
  1412.    * $Log: head.h,v $
  1413.    * Revision 4.4  1991/09/09  20:18:23  sob
  1414.    * release 4.4
  1415.    *
  1416. --- 1,9 ----
  1417. ! /* $Id: head.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1418.    *
  1419.    * $Log: head.h,v $
  1420. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1421. +  * Release 4.4 Patchlevel 3
  1422. +  *
  1423.    * Revision 4.4  1991/09/09  20:18:23  sob
  1424.    * release 4.4
  1425.    *
  1426. ***************
  1427. *** 142,150 ****
  1428.   #ifdef ASYNC_PARSE
  1429.       int        parse_maybe ANSI((ART_NUM));
  1430.   #endif
  1431. ! char    *fetchsubj ANSI((ART_NUM,bool,bool));
  1432.   char    *fetchlines ANSI((ART_NUM,int));
  1433.   
  1434.   #ifdef DEBUGGING
  1435. ! int    dumpheader ANSI((char *));
  1436.   #endif
  1437. --- 145,153 ----
  1438.   #ifdef ASYNC_PARSE
  1439.       int        parse_maybe ANSI((ART_NUM));
  1440.   #endif
  1441. ! char    *fetchsubj ANSI((ART_NUM,bool_int,bool_int));
  1442.   char    *fetchlines ANSI((ART_NUM,int));
  1443.   
  1444.   #ifdef DEBUGGING
  1445. ! void    dumpheader ANSI((char *));
  1446.   #endif
  1447. Index: init.c
  1448. Prereq: 4.4
  1449. *** init.c    Sat Nov  9 14:42:24 1991
  1450. --- ../rn4.4.3/init.c    Sat Feb 22 21:55:02 1992
  1451. ***************
  1452. *** 1,6 ****
  1453. ! /* $Id: init.c,v 4.4 1991/09/09 20:18:23 sob Exp sob $
  1454.    *
  1455.    * $Log: init.c,v $
  1456.    * Revision 4.4  1991/09/09  20:18:23  sob
  1457.    * release 4.4
  1458.    *
  1459. --- 1,9 ----
  1460. ! /* $Id: init.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1461.    *
  1462.    * $Log: init.c,v $
  1463. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1464. +  * Release 4.4 Patchlevel 3
  1465. +  *
  1466.    * Revision 4.4  1991/09/09  20:18:23  sob
  1467.    * release 4.4
  1468.    *
  1469. ***************
  1470. *** 190,244 ****
  1471.       util_init();
  1472.   
  1473.   #ifdef FINDNEWNG
  1474. - /*  fstat(actfp->_file,&filestat);    ... does not work on Apollos */
  1475. -     fstat(fileno(actfp),&filestat);    /* did active file grow? */
  1476.       /*
  1477.        * Skip this check if the -q flag was given.
  1478.        */
  1479. !     
  1480. !     if (!quickstart && filestat.st_size != lastactsiz) {
  1481. !     long actsiz = filestat.st_size;    /* remember new size */
  1482. !     NG_NUM oldnext = nextrcline;    /* remember # lines in newsrc */
  1483. ! #ifdef FASTNEW
  1484. !     bool munged = writesoft || !lastactsiz;
  1485. !                     /* bad soft ptrs -> edited active */
  1486. ! #else
  1487. !     bool munged = TRUE;        /* just assume .newsrc munged */
  1488. ! #endif
  1489. ! #ifdef VERBOSE
  1490. !     IF(verbose)
  1491. !         fputs("\nChecking active list for new newsgroups...\n",stdout)
  1492. !           FLUSH;
  1493. !     ELSE
  1494. ! #endif
  1495. ! #ifdef TERSE
  1496. !         fputs("\nNew newsgroups:\n",stdout) FLUSH;
  1497. ! #endif
  1498. ! #ifdef FASTNEW
  1499. !     if (!munged) {            /* maybe just do tail of file? */
  1500. !         fseek(actfp,lastactsiz-NL_SIZE,0);
  1501. !         fgets(buf,LBUFLEN,actfp);
  1502. !         munged = (*buf != '\n');
  1503. !         if (!munged)
  1504. !         munged = newlist(munged,FALSE);
  1505. !     }
  1506. ! #endif
  1507. !     if (munged) {            /* must we scan entire file? */
  1508. !         fseek(actfp,0L,0);        /* rewind active file */
  1509. !         newlist(munged,FALSE);      /* sure hope they use hashing... */
  1510. !     }
  1511. !     lastactsiz = actsiz;        /* remember for .rnlast */
  1512. !     if (nextrcline != oldnext) {    /* did we add any new groups? */
  1513.           foundany = TRUE;        /* let main() know */
  1514. !         starthere = 0;              /* and start ng scan from the top */
  1515.       }
  1516.       }
  1517.   #endif
  1518.       time(&lasttime);            /* remember when we inited-- */
  1519.                       /* ends up back in .rnlast */
  1520. !     writelast();                       /* in fact, put it there now */
  1521. !     
  1522.   #ifdef FINDNEWNG
  1523.   # ifdef ONLY
  1524.       if (maxngtodo)            /* patterns on command line? */
  1525. --- 193,212 ----
  1526.       util_init();
  1527.   
  1528.   #ifdef FINDNEWNG
  1529.       /*
  1530.        * Skip this check if the -q flag was given.
  1531.        */
  1532. !     if (!quickstart) {
  1533. !     if (find_new_groups()) {    /* did we add any new groups? */
  1534.           foundany = TRUE;        /* let main() know */
  1535. !         starthere = 0;        /* start ng scan from the top */
  1536.       }
  1537.       }
  1538.   #endif
  1539.       time(&lasttime);            /* remember when we inited-- */
  1540.                       /* ends up back in .rnlast */
  1541. !     writelast();            /* in fact, put it there now */
  1542.   #ifdef FINDNEWNG
  1543.   # ifdef ONLY
  1544.       if (maxngtodo)            /* patterns on command line? */
  1545. ***************
  1546. *** 333,339 ****
  1547.       char *newsnewsname = filexp(NEWSNEWSNAME);
  1548.   
  1549.       if ((tmpfp = fopen(newsnewsname,"r")) != Nullfp) {
  1550. - /*    fstat(tmpfp->_file,&filestat);   .... does not work on Apollos */
  1551.       fstat(fileno(tmpfp),&filestat);
  1552.       if (filestat.st_mtime > lasttime) {
  1553.           while (fgets(buf,sizeof(buf),tmpfp) != Nullch)
  1554. --- 301,306 ----
  1555. Index: intrp.c
  1556. Prereq: 4.4.2.1
  1557. *** intrp.c    Sun Dec  1 12:09:20 1991
  1558. --- ../rn4.4.3/intrp.c    Sat Feb 22 21:54:24 1992
  1559. ***************
  1560. *** 1,6 ****
  1561. ! /* $Id: intrp.c,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  1562.    *
  1563.    * $Log: intrp.c,v $
  1564.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  1565.    * Patchlevel 2 changes
  1566.    *
  1567. --- 1,9 ----
  1568. ! /* $Id: intrp.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1569.    *
  1570.    * $Log: intrp.c,v $
  1571. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1572. +  * Release 4.4 Patchlevel 3
  1573. +  *
  1574.    * Revision 4.4.2.1  1991/12/01  18:05:42  sob
  1575.    * Patchlevel 2 changes
  1576.    *
  1577. ***************
  1578. *** 715,723 ****
  1579.               s = getval("NAME",realname);
  1580.               break;
  1581.           case 'o':            /* organization */
  1582.               s = getenv("NEWSORG");
  1583. !             if ( s == Nullch) 
  1584.               s = getval("ORGANIZATION",orgname); 
  1585.   #ifdef ORGFILE
  1586.               if (*s == '/') {
  1587.               FILE *ofp = fopen(s,"r");
  1588. --- 718,730 ----
  1589.               s = getval("NAME",realname);
  1590.               break;
  1591.           case 'o':            /* organization */
  1592. + #ifdef IGNOREORG
  1593. +             s = getval("NEWSORG",orgname); 
  1594. + #else
  1595.               s = getenv("NEWSORG");
  1596. !             if (s == Nullch) 
  1597.               s = getval("ORGANIZATION",orgname); 
  1598. + #endif
  1599.   #ifdef ORGFILE
  1600.               if (*s == '/') {
  1601.               FILE *ofp = fopen(s,"r");
  1602. ***************
  1603. *** 725,732 ****
  1604.               if (ofp) {
  1605.                   fgets(scrbuf,sizeof scrbuf,ofp);
  1606.                   fclose(ofp);
  1607.                   s = scrbuf;
  1608. -                 s[strlen(s)-1] = '\0';
  1609.               }
  1610.               }
  1611.   #endif
  1612. --- 732,741 ----
  1613.               if (ofp) {
  1614.                   fgets(scrbuf,sizeof scrbuf,ofp);
  1615.                   fclose(ofp);
  1616. +                 s = scrbuf+strlen(scrbuf)-1;
  1617. +                 if (*s == '\n')
  1618. +                 *s = '\0';
  1619.                   s = scrbuf;
  1620.               }
  1621.               }
  1622.   #endif
  1623. ***************
  1624. *** 1094,1100 ****
  1625.   long uid;
  1626.   {
  1627.       char *s, *c;
  1628. !     char tmpbuf[512];
  1629.   #ifdef PASSNAMES
  1630.   #ifdef GETPWENT
  1631.   #ifdef notdef
  1632. --- 1103,1109 ----
  1633.   long uid;
  1634.   {
  1635.       char *s, *c;
  1636.   #ifdef PASSNAMES
  1637.   #ifdef GETPWENT
  1638.   #ifdef notdef
  1639. ***************
  1640. *** 1104,1110 ****
  1641. --- 1113,1121 ----
  1642.       
  1643.       s = pwd->pw_gecos;
  1644.   #else
  1645. +     char tmpbuf[512];
  1646.       int i;
  1647.       getpw(uid, tmpbuf);
  1648.       for (s=tmpbuf, i=GCOSFIELD-1; i; i--) {
  1649.       if (s)
  1650. ***************
  1651. *** 1136,1142 ****
  1652.       *c = '\0';
  1653.       if ((c = index(s, '-')) != Nullch)
  1654.       s = c;
  1655. !     strcpy(buf,tmpbuf);
  1656.   #endif
  1657.   #ifdef GETPWENT
  1658.       endpwent();
  1659. --- 1147,1153 ----
  1660.       *c = '\0';
  1661.       if ((c = index(s, '-')) != Nullch)
  1662.       s = c;
  1663. !     strcpy(buf,s);
  1664.   #endif
  1665.   #ifdef GETPWENT
  1666.       endpwent();
  1667. Index: last.c
  1668. Prereq: 4.4
  1669. *** last.c    Sat Nov  9 14:41:27 1991
  1670. --- ../rn4.4.3/last.c    Sat Feb 22 21:53:53 1992
  1671. ***************
  1672. *** 1,6 ****
  1673. ! /* $Id: last.c,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1674.    *
  1675.    * $Log: last.c,v $
  1676.    * Revision 4.4  1991/09/09  20:23:31  sob
  1677.    * release 4.4
  1678.    *
  1679. --- 1,9 ----
  1680. ! /* $Id: last.c,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1681.    *
  1682.    * $Log: last.c,v $
  1683. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1684. +  * Release 4.4 Patchlevel 3
  1685. +  *
  1686.    * Revision 4.4  1991/09/09  20:23:31  sob
  1687.    * release 4.4
  1688.    *
  1689. ***************
  1690. *** 43,48 ****
  1691. --- 46,59 ----
  1692.       lasttime = atol(tcbuf);
  1693.       fgets(tcbuf,1024,tmpfp);
  1694.       lastactsiz = atol(tcbuf);
  1695. +     if (fgets(tcbuf,1024,tmpfp) != Nullch)
  1696. +         lastnewtime = atol(tcbuf);
  1697. +     else
  1698. +         lastnewtime = (lasttime? lasttime : time(Null(time_t*))-24L*60*60);
  1699. +     if (fgets(tcbuf,1024,tmpfp) != Nullch)
  1700. +         lastnewsize = atol(tcbuf);
  1701. +     else
  1702. +         lastnewsize = 0;
  1703.       fclose(tmpfp);
  1704.       }
  1705.       else {
  1706. ***************
  1707. *** 49,54 ****
  1708. --- 60,68 ----
  1709.       lastngname = nullstr;
  1710.       lasttime = 0;
  1711.       lastactsiz = 0;
  1712. +     lastnewsize = 0;
  1713. +     /* Use yesterday as an initial value for finding new groups. */
  1714. +     lastnewtime = time(Null(time_t*)) - 24L*60*60;
  1715.       }
  1716.   }
  1717.   
  1718. ***************
  1719. *** 58,65 ****
  1720.   writelast()
  1721.   {
  1722.       if ((tmpfp = fopen(lastname,"w")) != Nullfp) {
  1723. !     fprintf(tmpfp,"%s\n%ld\n%ld\n",
  1724. !         (ngname==Nullch?nullstr:ngname),(long)lasttime,(long)lastactsiz);
  1725.       fclose(tmpfp);
  1726.       }
  1727.       else
  1728. --- 72,80 ----
  1729.   writelast()
  1730.   {
  1731.       if ((tmpfp = fopen(lastname,"w")) != Nullfp) {
  1732. !     fprintf(tmpfp,"%s\n%ld\n%ld\n%ld\n%ld\n",
  1733. !         (ngname==Nullch?nullstr:ngname),(long)lasttime,(long)lastactsiz,
  1734. !         (long)lastnewtime,(long)lastnewsize);
  1735.       fclose(tmpfp);
  1736.       }
  1737.       else
  1738. Index: last.h
  1739. Prereq: 4.4
  1740. *** last.h    Sat Nov  9 14:41:35 1991
  1741. --- ../rn4.4.3/last.h    Sat Feb 22 21:53:59 1992
  1742. ***************
  1743. *** 1,6 ****
  1744. ! /* $Id: last.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
  1745.    *
  1746.    * $Log: last.h,v $
  1747.    * Revision 4.4  1991/09/09  20:23:31  sob
  1748.    * release 4.4
  1749.    *
  1750. --- 1,9 ----
  1751. ! /* $Id: last.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
  1752.    *
  1753.    * $Log: last.h,v $
  1754. +  * Revision 4.4.3.1  1992/02/01  03:09:32  sob
  1755. +  * Release 4.4 Patchlevel 3
  1756. +  *
  1757.    * Revision 4.4  1991/09/09  20:23:31  sob
  1758.    * release 4.4
  1759.    *
  1760. ***************
  1761. *** 23,28 ****
  1762. --- 26,33 ----
  1763.   EXT char *lastngname INIT(Nullch);    /* last newsgroup read, from .rnlast file */
  1764.   EXT long lasttime INIT(0);    /* time last rn was started up */
  1765.   EXT long lastactsiz INIT(0);    /* size of active file when rn last started up */
  1766. + EXT long lastnewtime INIT(0);    /* time last new group was found */
  1767. + EXT long lastnewsize INIT(0);    /* size of active.times file when rn last started up */
  1768.   
  1769.   void    last_init ANSI((char *));
  1770.   void    writelast ANSI((void));
  1771.